package com.sky.config;


import com.sky.properties.BaiduProperties;
import com.sky.utils.AliOssUtil;
import com.sky.utils.BaiduUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Slf4j
@Configuration
public class BaiduConfiguration {

    @Bean
    @ConditionalOnMissingBean
    public BaiduUtil baiduUtil(BaiduProperties baiduProperties) {
        log.info("开始创建百度地图地址索引：{}",baiduProperties);
        return new BaiduUtil(
                baiduProperties.getAk(),
                baiduProperties.getUrl(),
                baiduProperties.getAddress()
        );
    }


}
